<?php defined('IN_ADMIN') or exit('Access Denied!'); ?>
<div class="subnav">
  <div class="content-menu ib-a blue line-x">
    <a href="javascript:window.top._MP(201,'/admin/album/list/<?=$shop_id;?>');"><em>相册管理</em></a> <span>|</span>
    <a href="javascript:window.top._MP(202,'/admin/album_cat/list/<?=$shop_id;?>');" class="on"><em>相册分类</em></a> <span>|</span>
    <a href="#" onClick="show_dialog('addcat', '/admin/album_cat/create/<?=$shop_id;?>', '添加新分类', 500, 200)"><em>添加分类</em></a>
  </div>
</div>
<form name="myform" action="/admin/album_cat/save/<?=$shop_id;?>" method="post">
  <input type="hidden" name="method" value="upgrade" />
  <div class="pad_10">
    <div class="table-list">
      <table width="100%" cellspacing="0">
        <thead>
          <tr>
            <th width="38">排序</th>
            <th width="30">Id</th>
            <th>名称</th>
            <th width="50">图片数量</th>
            <th width="250">管理操作</th>
          </tr>
        </thead>
        <tbody>
    <?php
    if(is_array($list) && count($list)){
      foreach($list as $item){
    ?>
          <tr>
            <td align="center"><input name="sorts[<?=$item['album_cat'];?>]" type="text" size="3" value="<?=$item['ordnum'];?>" class="input-text-c"></td>
            <td align="center"><?=$item['album_cat'];?></td>
            <td><?=h($item['cat_name']);?></td>
            <td align="center"><?=i($item['pic_num']);?></td>
            <td align="center">
                <a href="/admin/album/list/<?=$shop_id;?>?album_cat=<?=$item['album_cat'];?>">进入该相册</a>
                <span>|</span>
                <a href="#" onclick="show_dialog('editcat', '/admin/album_cat/modify/<?=$shop_id;?>-<?=$item['album_cat'];?>', '编辑名称', 500, 200)">编辑名称</a>
                <span>|</span>
                <a href="/admin/album_cat/delete/<?=$shop_id;?>?album_cat=<?=$item['album_cat'];?>" onclick="return confirm('确定要删除该项目?')">删除</a>
            </td>
          </tr>
    <?php
         }
      }else{
    ?>
          <tr><td colspan="5" height="50" align="center">暂无数据</td></tr>
    <?php
      }
    ?>
        </tbody>
      </table>
    <?php
      if(is_array($list) && count($list)){
    ?>
      <div class="btn">
        <input type="submit" class="button" name="dosubmit" id="dosubmit" value="更新" />
        <span>|</span>
        <a href="#" onClick="show_dialog('addcat', '/admin/album_cat/create/<?=$shop_id;?>', '添加新分类', 500, 200)"><em>添加分类</em></a>
      </div>
    <?php
      }
    ?>
    </div>
  </div>
</form>
<script type="text/javascript">
$(document).ready(function(){
    $('form').submit(function(){
        return true;
    });
});
</script>